from django.urls import path,re_path
from hello.views import hello_world, hello_china, hello_html, article_list, search, render_str, render_html, \
    http_request, http_response, no_data_404, article_detail, index, HomeView, tag, test_filter, mine_filter

urlpatterns = [
    path('world/', hello_world,name='hello_world'),  #hello/world/ URL路径
    path('china/', hello_china,name='hello_china'),   #hello/china/ URL路径
    path('html/', hello_html,name='hello_html'),   #hello/china/ URL路径
    #path('article/<int:month>/', article_list,name='article_list'),   #hello/article/month(1...) URL路径
    #re_path(r'^article/(?P<month>0?[1-9]|1[012])/$', article_list,name='article_list'),   #hello/article/month(1...) URL路径
    #?P<名字>；第一位数字是1-9,0?[1-9]；第二位数字是0-2，1[012]；   正则表达式的开头r'^，结尾/$
    path('search/', search,name='search'),   #hello/search/?name=xxx  URL路径
    # 不推荐 path('render/str/', render_str,name='render_str'),  #hello/render/str/   URL路径
    path('render/html/', render_html,name='render_html'),  #hello/render/html/   URL路径
    path('http/req/', http_request,name='http_request'),  #hello/http/req/   URL路径
    path('http/resp/', http_response,name='http_response'),  #hello/http/resp/   URL路径
    path('404/', no_data_404,name='no_data_404'),  #hello/404/   URL路径
    path('article/<int:article_id>/', article_detail,name='article_detail'),
    path('index/', index,name='index'),
    path('home/', HomeView.as_view(),name='home'),
    path('tag/', tag,name='tag'),
    path('test/filter/', test_filter,name='test_filter'),
    path('mine/filter/', mine_filter,name='mine_filter'),

]